package com.adingxiong.cft.design.servicelocation;

/**
 * @ClassName Test
 * @Description  服务定位器模式  原理等同于缓存技术  工厂模式 + 缓存
 * @Author xiongchao
 * @Date 2021/1/8 9:39
 **/
public class Test {

    public static void main(String[] args) {
        Service service1 = ServiceLocator.getService("service1");
        service1.execute();

        Service service2 = ServiceLocator.getService("service2");
        service2.execute();

        Service service3 = ServiceLocator.getService("service1");
        service3.execute();

        Service service4 = ServiceLocator.getService("service2");
        service4.execute();
    }
}
